import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:getwidget/getwidget.dart';
import 'package:meal/constant/sizes.dart';
import 'package:meal/route/route.dart';
import 'package:meal/utils/colors.dart';
import 'package:meal/utils/styles.dart';
import 'package:meal/utils/tools.dart';

///
/// 解绑手机
///
class MobileUnbind extends StatefulWidget {
  const MobileUnbind({Key? key}) : super(key: key);

  @override
  State<MobileUnbind> createState() => _MobileUnbindState();
}

class _MobileUnbindState extends State<MobileUnbind> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: ToolsUtils.getDefaultBrnAppBar('解绑手机'),
      body: SingleChildScrollView(
          child: Container(
        decoration: const BoxDecoration(color: Colors.white),
        margin: const EdgeInsets.only(bottom: Sizes.default20),
        child: Column(
          children: [
            Container(
              margin: const EdgeInsets.only(top: Sizes.default40),
              alignment: Alignment.center,
              child: ToolsUtils.getUrlSvg(
                  'https://cdn7.axureshop.com/demo/1525603/images/绑定手机号/u11458.svg',
                  width: 100,
                  height: 150),
            ),
            Container(
              margin: const EdgeInsets.only(top: Sizes.default10),
              alignment: Alignment.center,
              child: Text('当前绑定手机号：135*****037',
                  softWrap: true,
                  style: StylesUtils.customTextStyle(
                      fontSize: Sizes.default16, color: ColorsUtils.color333)),
            ),
            Container(
              width: double.maxFinite,
              margin: const EdgeInsets.only(top: Sizes.default30, bottom: Sizes.default40),
              padding: const EdgeInsets.symmetric(horizontal: Sizes.default15),
              child: GFButton(
                onPressed: () {
                  Get.toNamed(RouteGet.userMobileBind);
                },
                text: '更换手机号',
                textStyle: StylesUtils.customTextStyle(
                    color: ColorsUtils.colorFf6, fontSize: Sizes.default16),
                shape: GFButtonShape.pills,
                type: GFButtonType.outline,
                size: GFSize.LARGE,
                borderSide:
                    BorderSide(color: ColorsUtils.parseColorFromHexString(ColorsUtils.colorFf6)),
              ),
            )
          ],
        ),
      )),
    );
  }
}
